import {ref } from 'vue'
export function useVideoPlayer(){
    const currentPlaying=ref<HTMLAudioElement|null>(null)
    const startPlaying=(video:HTMLAudioElement)=>{
        if(currentPlaying.value!==video){
            if(currentPlaying.value){
                currentPlaying.value.pause()
            }
            currentPlaying.value=video
            video.play()
        }
    }
    return{
        startPlaying
    }
}